package com.wswy.wzcx.ui.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.che.libcommon.ui.BaseFragment;
import com.wswy.wzcx.R;
import com.wswy.wzcx.ui.other.LayoutHelper;

/**
 * Created by wangduheng26 on 2018/2/6.
 * wangduheng26@gmail.com
 */

public class ListenerFragment extends BaseFragment {
    public static final String TAG = "ListenerFragment";

    @Override
    public String getFragmentTitle() {
        return "特别声明";
    }

    public static ListenerFragment newInstance() {

        Bundle args = new Bundle();

        ListenerFragment fragment = new ListenerFragment();
        fragment.setArguments(args);
        return fragment;
    }

    TextView textView;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Context context = container.getContext();
        assert context != null;
        FrameLayout layout = new FrameLayout(context);
        LayoutHelper.setPadding(layout,16);
        layout.setBackgroundColor(ContextCompat.getColor(context, R.color.default_background_color));
        textView = new TextView(context);
        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
        layout.addView(textView);
        return layout;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        textView.setText(R.string.listener_app);
    }
}
